
<!DOCTYPE html>

<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

    <title>Detailed device dictionary information in LAVA Scheduler &#8212; LAVA 2024.05 documentation</title>
    <link rel="stylesheet" type="text/css" href="_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="_static/bootstrap-sphinx.css" />
    <script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
    <script src="_static/jquery.js"></script>
    <script src="_static/underscore.js"></script>
    <script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
    <script src="_static/doctools.js"></script>
    <script src="_static/sphinx_highlight.js"></script>
    <link rel="shortcut icon" href="_static/favicon.ico"/>
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
    <link rel="next" title="Job submission failure help" href="lava-scheduler-submit-job.html" />
    <link rel="prev" title="Device type information in LAVA Scheduler" href="lava-scheduler-device-type-help.html" />
    <link rel="canonical" href="https://docs.lavasoftware.org/lava/lava-scheduler-device-dictionary.html" />
  
<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
<meta name="apple-mobile-web-app-capable" content="yes">
<script type="text/javascript" src="_static/js/jquery-1.12.4.min.js"></script>
<script type="text/javascript" src="_static/js/jquery-fix.js"></script>
<script type="text/javascript" src="_static/bootstrap-3.4.1/js/bootstrap.min.js"></script>
<script type="text/javascript" src="_static/bootstrap-sphinx.js"></script>


  </head><body>

  <div id="navbar" class="navbar navbar-default navbar-fixed-top">
    <div class="container">
      <div class="navbar-header">
        <!-- .btn-navbar is used as the toggle for collapsed navbar content -->
        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
        </button>
        <a class="navbar-brand" href="index.html"><span><img src="_static/lava.png"></span>
          LAVA</a>
        <span class="navbar-text navbar-version pull-left"><b>2024.05</b></span>
      </div>

        <div class="collapse navbar-collapse nav-collapse">
          <ul class="nav navbar-nav">
            
                <li><a href="genindex.html">Index</a></li>
                <li><a href="contents.html">Contents</a></li>
            
            
              <li class="dropdown globaltoc-container">
  <a role="button"
     id="dLabelGlobalToc"
     data-toggle="dropdown"
     data-target="#"
     href="index.html">Site <b class="caret"></b></a>
  <ul class="dropdown-menu globaltoc"
      role="menu"
      aria-labelledby="dLabelGlobalToc"><ul class="current">
<li class="toctree-l1"><a class="reference internal" href="index.html">Introduction to LAVA</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="contents.html">Contents</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="glossary.html">Glossary of terms</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="support.html">Getting support</a></li>
</ul>
</ul>
</li>
              
                <li class="dropdown">
  <a role="button"
     id="dLabelLocalToc"
     data-toggle="dropdown"
     data-target="#"
     href="#">Page <b class="caret"></b></a>
  <ul class="dropdown-menu localtoc"
      role="menu"
      aria-labelledby="dLabelLocalToc"><ul>
<li><a class="reference internal" href="#">Detailed device dictionary information in LAVA Scheduler</a><ul>
<li><a class="reference internal" href="#commands">Commands</a></li>
<li><a class="reference internal" href="#connections">Connections</a></li>
<li><a class="reference internal" href="#vland-support">VLANd support</a></li>
<li><a class="reference internal" href="#exported-parameters">Exported parameters</a></li>
<li><a class="reference internal" href="#other-parameters">Other parameters</a></li>
</ul>
</li>
</ul>
</ul>
</li>
              
            
            
              
                
  <li>
    <a href="lava-scheduler-device-type-help.html" title="Previous Chapter: Device type information in LAVA Scheduler"><span class="glyphicon glyphicon-chevron-left visible-sm"></span><span class="hidden-sm hidden-tablet">&laquo; Device type i...</span>
    </a>
  </li>
  <li>
    <a href="lava-scheduler-submit-job.html" title="Next Chapter: Job submission failure help"><span class="glyphicon glyphicon-chevron-right visible-sm"></span><span class="hidden-sm hidden-tablet">Job submissio... &raquo;</span>
    </a>
  </li>
              
            
            
            
            
              <li class="hidden-sm"></li>
            
          </ul>

          
            
<form class="navbar-form navbar-right" action="search.html" method="get">
 <div class="form-group">
  <input type="text" name="q" class="form-control" placeholder="Search" />
 </div>
  <input type="hidden" name="check_keywords" value="yes" />
  <input type="hidden" name="area" value="default" />
</form>
          
        </div>
    </div>
  </div>

<div class="container">
  <div class="row">
    <div class="body col-md-12 content" role="main">
      
  <section id="detailed-device-dictionary-information-in-lava-scheduler">
<span id="device-dictionary-help"></span><span id="index-0"></span><h1>Detailed device dictionary information in LAVA Scheduler<a class="headerlink" href="#detailed-device-dictionary-information-in-lava-scheduler" title="Permalink to this heading">¶</a></h1>
<p>Each <a class="reference internal" href="glossary.html#term-device-type"><span class="xref std std-term">device type</span></a> in LAVA defines a template to describe the features of
that device type, and how LAVA can use it. A <a class="reference internal" href="glossary.html#term-device-dictionary"><span class="xref std std-term">device dictionary</span></a>
customizes that template to include the data for one specific instance of that
device. This includes details like the commands to connect specific serial
ports for this device, commands to operate remote power control, device serial
numbers and elements of the network topology for <a class="reference internal" href="glossary.html#term-VLANd"><span class="xref std std-term">VLANd</span></a> support.</p>
<p>Other fields can also be used in the templates. The only field which is
compulsory is <strong>extends</strong> which links this device dictionary to a specific
device type template.</p>
<section id="commands">
<span id="device-dictionary-commands"></span><h2>Commands<a class="headerlink" href="#commands" title="Permalink to this heading">¶</a></h2>
<ul class="simple">
<li><p><strong>connection_command</strong> - <strong>deprecated</strong> command to access the serial port of
the device.</p>
</li>
<li><p><strong>power_on_command</strong> - command to supply power to the device remotely. (The
device <strong>must</strong> start the boot sequence on application of power.)</p></li>
<li><p><strong>power_off_command</strong> - command to terminate power to the device remotely.</p></li>
<li><p><strong>soft_reboot_command</strong> - command to issue at a prompt of a running system to
request a reboot.</p></li>
<li><p><strong>hard_reset_command</strong> - command to abruptly terminate power and then supply
power to the device remotely. May include a delay using <code class="docutils literal notranslate"><span class="pre">sleep</span></code>.</p></li>
<li><p><strong>pre_power_command</strong> - ancillary command used for special cases, dependent
on deployment method and device type template support.</p></li>
<li><p><strong>pre_os_command</strong>  - ancillary command used for special cases, dependent
on deployment method and device type template support.</p></li>
<li><p><strong>device_info</strong> - a list of dictionaries, where each dictionary value can
contain keys such as ‘board_id’, ‘usb_vendor_id’, ‘usb_product_id’,
‘wait_device_board_id’, which can be added to the LXC for device specific
tasks dynamically, whenever the device is reset, using a <code class="docutils literal notranslate"><span class="pre">udev</span></code> rule.</p></li>
<li><p><strong>static_info</strong> - a list of dictionaries, where each dictionary value can
contain keys such as ‘board_id’, ‘usb_vendor_id’, ‘usb_product_id’, which
will be added to the LXC for device specific tasks when the LXC is started.
Used for static devices which are always visible to the dispatcher, for
example the ARM Energy Probe which has a USB connection to the dispatcher
and probe connections to the device.</p></li>
<li><p><strong>adb_serial_number</strong> - value to pass to ADB to connect to this device.</p></li>
<li><p><strong>fastboot_serial_number</strong> - value to pass to <code class="docutils literal notranslate"><span class="pre">fastboot</span></code> to connect to this
device.</p></li>
<li><p><strong>fastboot_options</strong> - a list of strings, used for specifying additional
options to the <code class="docutils literal notranslate"><span class="pre">fastboot</span></code> command.</p></li>
</ul>
</section>
<section id="connections">
<span id="device-dictionary-connections"></span><h2>Connections<a class="headerlink" href="#connections" title="Permalink to this heading">¶</a></h2>
<ul>
<li><p><strong>connection_list</strong> - the list of hardware ports which are configured for
serial connections to the device.</p></li>
<li><p><strong>connection_commands</strong> - a dictionary of the commands to start each
connection.</p></li>
<li><p><strong>connection_tags</strong> -  Each connection can include <code class="docutils literal notranslate"><span class="pre">tags</span></code> - extra pieces of
metadata to describe the connection.</p>
<p>There must always be one (and only one) connection with the <code class="docutils literal notranslate"><span class="pre">primary</span></code> tag,
denoting the connection that will be used for firmware, bootloader and kernel
interaction.</p>
<p>Other tags may describe the <em>type</em> of connection, as extra information that
LAVA can use to determine how to close the connection cleanly when a job
finishes (e.g <code class="docutils literal notranslate"><span class="pre">telnet</span></code> and <code class="docutils literal notranslate"><span class="pre">ssh</span></code>).</p>
</li>
</ul>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="pipeline-admin.html#create-device-dictionary"><span class="std std-ref">Creating a device dictionary for the device</span></a>, <a class="reference internal" href="connections.html#configuring-serial-ports"><span class="std std-ref">Configuring serial ports</span></a>
and <a class="reference internal" href="pipeline-admin.html#viewing-device-dictionary-content"><span class="std std-ref">Viewing current device dictionary content</span></a>.</p>
</div>
</section>
<section id="vland-support">
<h2>VLANd support<a class="headerlink" href="#vland-support" title="Permalink to this heading">¶</a></h2>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="vland.html#vlan-support"><span class="std std-ref">VLANd and LAVA</span></a></p>
</div>
<ul class="simple">
<li><p><strong>interfaces</strong> - the list of interface labels supported by the device.</p></li>
<li><p><strong>tags</strong> - a dictionary of interface labels containing a list of the
<a class="reference internal" href="glossary.html#term-interface-tag"><span class="xref std std-term">interface tags</span></a> for each label.</p></li>
<li><p><strong>map</strong> - the <a class="reference internal" href="vland-admin.html#vland-network-map"><span class="std std-ref">network map</span></a> as it relates to this
device. A dictionary of interface labels containing a dictionary of the
switch name and port number relating to the physical cable connection to the
interface associated with the interface label on that device.</p></li>
<li><p><strong>mac_addr</strong> - a dictionary of interface labels containing the MAC address
of the interface associated with the interface label on that device.</p></li>
<li><p><strong>sysfs</strong> - a dictionary of interface labels containing the <code class="docutils literal notranslate"><span class="pre">sysfs</span></code> path of
the interface associated with the interface label on that device.</p></li>
</ul>
<p>The “download” button present in the <a class="reference internal" href="glossary.html#term-device-dictionary"><span class="xref std std-term">device dictionary</span></a> page is used to
download a YAML file of the <a class="reference internal" href="glossary.html#term-device-dictionary"><span class="xref std std-term">device dictionary</span></a>, which is the equivalent
of contents returned by <cite>lavacli devices dict get</cite>. This file
is not intended for admin support and cannot be used to modify the
<a class="reference internal" href="glossary.html#term-device-dictionary"><span class="xref std std-term">device dictionary</span></a> itself.</p>
</section>
<section id="exported-parameters">
<span id="device-dictionary-exported-parameters"></span><span id="index-1"></span><h2>Exported parameters<a class="headerlink" href="#exported-parameters" title="Permalink to this heading">¶</a></h2>
<p>Some elements of the device configuration can be exposed to the test shell,
where it is safe to do so. Each parameter must be explicitly set in each device
dictionary. The information will then be populated into the
<a class="reference internal" href="writing-tests.html#lava-test-helpers"><span class="std std-ref">LAVA Test Helpers</span></a>.</p>
<ul>
<li><p><strong>device_ip</strong> - A single fixed IPv4 address of this device. The value will be
exported into the test shell using <code class="docutils literal notranslate"><span class="pre">lava-target-ip</span></code>.</p>
<div class="highlight-jinja notranslate"><div class="highlight"><pre><span></span><span class="cp">{%</span> <span class="k">set</span> <span class="nv">device_ip</span> <span class="o">=</span> <span class="s2">&quot;10.66.16.24&quot;</span> <span class="cp">%}</span>
</pre></div>
</div>
</li>
<li><p><strong>device_mac</strong> - similar to <code class="docutils literal notranslate"><span class="pre">device_ip</span></code> but for a single MAC address.</p>
<div class="highlight-jinja notranslate"><div class="highlight"><pre><span></span><span class="cp">{%</span> <span class="k">set</span> <span class="nv">device_mac</span> <span class="o">=</span> <span class="s1">&#39;00:02:F7:00:58:53&#39;</span> <span class="cp">%}</span>
</pre></div>
</div>
</li>
<li><p><strong>storage_info</strong> - a list of dictionaries, where each dictionary value can
contain keys describing the storage method (e.g. USB or SATA) and a value
stating the device node of the top level block device which is available to
the test writer.</p>
<div class="highlight-jinja notranslate"><div class="highlight"><pre><span></span><span class="cp">{%</span> <span class="k">set</span> <span class="nv">storage_info</span> <span class="o">=</span> <span class="o">[{</span><span class="s1">&#39;SATA&#39;</span><span class="o">:</span> <span class="s1">&#39;/dev/disk/by-id/ata-ST500DM002-1BD142_W3T79GCW&#39;</span><span class="o">}]</span> <span class="cp">%}</span>
</pre></div>
</div>
</li>
<li><p><strong>environment</strong> - a dictionary containing device-specific shell
variables, which will be available in the LAVA test shell. These can
be used, for example, to describe physical hardware connections
between the <a class="reference internal" href="glossary.html#term-DUT"><span class="xref std std-term">DUT</span></a> and interfaces on the worker or other
addressable hardware.</p>
<div class="highlight-jinja notranslate"><div class="highlight"><pre><span></span><span class="cp">{%</span> <span class="k">set</span> <span class="nv">environment</span> <span class="o">=</span> <span class="o">{</span>
    <span class="s1">&#39;RELAY_ADDRESS&#39;</span><span class="o">:</span> <span class="s1">&#39;10.66.16.103&#39;</span><span class="o">,</span>
    <span class="s1">&#39;REMOTE_SERIAL_PORT&#39;</span><span class="o">:</span> <span class="s1">&#39;/dev/ttyUSB2&#39;</span><span class="o">,</span>
<span class="o">}</span> <span class="cp">%}</span>
</pre></div>
</div>
</li>
</ul>
<p>For ease of use, LAVA will directly export the content of the
<strong>device_info</strong>, <strong>environment</strong>, <strong>static_info</strong> and <strong>storage_info</strong>
dictionaries into the test shell environment. The dictionaries and
lists will be unrolled, for example:</p>
<div class="highlight-jinja notranslate"><div class="highlight"><pre><span></span><span class="cp">{%</span> <span class="k">set</span> <span class="nv">static_info</span> <span class="o">=</span> <span class="o">[{</span><span class="s2">&quot;board_id&quot;</span><span class="o">:</span> <span class="s2">&quot;S_NO81730000&quot;</span><span class="o">},</span> <span class="o">{</span><span class="s2">&quot;board_id&quot;</span><span class="o">:</span> <span class="s2">&quot;S_NO81730001&quot;</span><span class="o">}]</span> <span class="cp">%}</span>
<span class="cp">{%</span> <span class="k">set</span> <span class="nv">storage_info</span> <span class="o">=</span> <span class="o">[{</span><span class="s1">&#39;SATA&#39;</span><span class="o">:</span> <span class="s1">&#39;/dev/disk/by-id/ata-ST500DM002-1BD142_W3T79GCW&#39;</span><span class="o">}]</span> <span class="cp">%}</span>
</pre></div>
</div>
<p>will become:</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span><span class="nb">export</span><span class="w"> </span><span class="nv">LAVA_STATIC_INFO_0_board_id</span><span class="o">=</span><span class="s1">&#39;S_NO81730000&#39;</span>
<span class="nb">export</span><span class="w"> </span><span class="nv">LAVA_STATIC_INFO_1_board_id</span><span class="o">=</span><span class="s1">&#39;S_NO81730001&#39;</span>
<span class="nb">export</span><span class="w"> </span><span class="nv">LAVA_STORAGE_INFO_0_SATA</span><span class="o">=</span><span class="s1">&#39;/dev/disk/by-id/ata-ST500DM002-1BD142_W3T79GCW&#39;</span>
</pre></div>
</div>
<p>The environment can be <strong>overridden in the job definition</strong>. See
<a class="reference internal" href="dispatcher-format.html#job-environment-support"><span class="std std-ref">Provide environment variables for the device in the job description</span></a>.</p>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="writing-tests.html#test-device-info"><span class="std std-ref">Obtaining information about the device</span></a> and <a class="reference internal" href="pipeline-admin.html#extra-device-configuration"><span class="std std-ref">Extra device configuration</span></a>.</p>
</div>
</section>
<section id="other-parameters">
<span id="device-dictionary-other-parameters"></span><h2>Other parameters<a class="headerlink" href="#other-parameters" title="Permalink to this heading">¶</a></h2>
<ul class="simple">
<li><p><strong>flash_cmds_order</strong> - a list of strings, used for specifying the order in
which the images should be flashed to the <a class="reference internal" href="glossary.html#term-DUT"><span class="xref std std-term">DUT</span></a> using the <code class="docutils literal notranslate"><span class="pre">fastboot</span></code>
command.</p></li>
</ul>
</section>
</section>


    </div>
      
  </div>
</div>
<footer class="footer">
  <div class="container">
    <p class="pull-right">
      <a href="#">Back to top</a>
      
    </p>
    <p>
        &copy; Copyright 2010-2019, Linaro Limited.<br/>
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 5.3.0.<br/>
    </p>
  </div>
</footer>
  </body>
</html>